<?php

namespace App\Http\Controllers;

use App\Helper\SmsCode;
use App\Models\AssistantRank;
use App\Models\UserRank;
use Illuminate\Http\Request;

class TestApiController extends Controller
{
    public function createAssistantRank(Request $request)
    {
        $date = $request->input('date', now()->toDateString());
        AssistantRank::createDailyRecord($date);
    }

    public function createUserRank(Request $request)
    {
        $date = $request->input('date', now()->toDateString());
        UserRank::createDailyRecord($date);
    }

    public function sendSmsCode(Request $request, SmsCode $smsCode)
    {
        $mobile = $request->input('telephone');
        $smsCode->send($mobile);
    }
}
